Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant enhancements to the
@Codable
macro by adding a new feature calledCodableOptions
, which allows for customizable behavior when encoding and decoding types.CodableOptions Implementation: A new
CodableOptions
structure has been introduced to enable users to customize the behavior of the@Codable
macro. This includes the ability to skip superclass encode/decode calls when the superclass does not conform toCodable
. This change enhances flexibility in code generation and allows for more tailored implementations of Codable types.Inheritance Logic Update: The logic within the
CodableMacro
has been updated to ensure that superclass coding is not skipped unless theskipSuperCoding
option is explicitly set. This ensures that all relevant properties from superclasses are encoded correctly, improving the handling of inheritance in Codable types.Comprehensive Testing: New tests have been added to validate the functionality of the
@Encodable
,@Decodable
, and@Codable
macros with the.skipSuperCoding
option. These tests ensure that the macros expand correctly to the expected Swift code and that the generated classes handle encoding and decoding appropriately, even when not inheriting properties from superclasses. This enhances the overall test coverage for the Codable macros.These changes aim to improve the usability and reliability of the Codable macros, making them more adaptable to various coding scenarios.